//
//  GanLuHongFile.h
//  GanLuApp
//
//  Created by luoy on 2024/4/3.
//

#import <Foundation/Foundation.h>

//获取屏幕的宽、高
#define KScreenWidth [UIScreen mainScreen].bounds.size.width
#define KScreenHeight [UIScreen mainScreen].bounds.size.height

// __block
#define kBlcokSelf(pSelf) __block typeof(&*self) pBlcokSelf = self

//状态栏的高度
#ifdef __IPHONE_13_0 //判断是否是13以上系统
#define statusBarHeight [[UIApplication sharedApplication] windows].firstObject.windowScene.statusBarManager.statusBarFrame.size.height
#else
#define statusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#endif

//状态栏+导航栏高度
#define NavAndstatusBarHeight (statusBarHeight+44)
//判断是否是刘海屏
#define iPhoneX ((statusBarHeight != 20) ? YES : NO)
//底部安全距离
#define bottomLayoutIPhoneX (iPhoneX ? 34 : 0)

//判断手机屏幕尺寸
//3.5寸屏幕
#define ThreePointFiveInch ([UIScreen mainScreen].bounds.size.height == 480.0)
//4.0寸屏幕（iPhone SE）
#define FourInch ([UIScreen mainScreen].bounds.size.height == 568.0)
//4.7寸屏幕（iPhone 6/6s/7/8/SE2）
#define FourPointSevenInch ([UIScreen mainScreen].bounds.size.height == 667.0)
//5.4寸屏幕（iPhone 12 mini/13 mini）
#define FivePointFourSevenInch ([UIScreen mainScreen].bounds.size.height == 780.0)
//5.5寸屏幕（iPhone 6p/7p/8p）
#define FivePointFiveSevenInch ([UIScreen mainScreen].bounds.size.height == 736.0)
//5.8寸屏幕（iPhone x/xs/11Pro）
#define FivePointEightSevenInch ([UIScreen mainScreen].bounds.size.height == 812.0)
//6.1（iPhone xr/11/12/12 Pro/13/13 Pro/14/14Pro）
#define SixPointOneSevenInch (([UIScreen mainScreen].bounds.size.height == 896.0 && [UIScreen mainScreen].scale == 2) || [UIScreen mainScreen].bounds.size.height == 844.0 || [UIScreen mainScreen].bounds.size.height == 852.0)
//6.5寸屏幕（iPhone xsMax/11ProMax）
#define SixPointFiveSevenInch ([UIScreen mainScreen].bounds.size.height == 896.0 && [UIScreen mainScreen].scale == 3)
//6.7寸屏幕(iPhone 12 Pro Max/13 Pro Max/14Plus/14ProMax)
#define SixPointSevenSevenInch ([UIScreen mainScreen].bounds.size.height == 926.0 || [UIScreen mainScreen].bounds.size.height == 932)

//判断是否从右往左读取（RTL，阿拉伯语是RTL）这里只适配了阿拉伯语
#define isRTL [[NSLocale preferredLanguages].firstObject hasPrefix:@"ar-"]

//设置颜色
#define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HexRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]

//GCD （子线程、主线程定义）
#define BACK(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)
#define MAIN(block) dispatch_async(dispatch_get_main_queue(),block)

// 获取版本号
#define LOCAL_RELEASE_VERSION [[NSBundle mainBundle]infoDictionary][@"CFBundleShortVersionString"]

// 获取手机型号
#define Phone_Model [[UIDevice currentDevice] model]

// 系统版本号
#define System_Version [[UIDevice currentDevice] systemVersion]
//设置本地图片
#define TL_IMAGE(name) [UIImage imageNamed:name]

NS_ASSUME_NONNULL_BEGIN

@interface GanLuHongFile : NSObject

@end

NS_ASSUME_NONNULL_END
